package com.example.ck.service.impl;

import com.example.ck.dao.SwiperDao;
import com.example.ck.entity.Swiper;
import com.example.ck.service.SwiperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (Swiper)表服务实现类
 *
 * @author makejava
 * @since 2024-05-10 15:48:09
 */
@Service("swiperService")
public class SwiperServiceImpl implements SwiperService {
    @Autowired
    private SwiperDao swiperDao;

    /**
     * 查询所有数据
     *
     * @return 实例对象
     */
    public List<Swiper>  query() {
        return swiperDao.selectList(null);
    }

    /**
     * 新增数据
     *
     * @param swiper 实例对象
     * @return 实例对象
     */
    public boolean insert(Swiper swiper) {
        return swiperDao.insert(swiper) > 0;
    }


    /**
     * 通过主键删除数据
     *
     * @param swiperId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer swiperId) {
        return swiperDao.deleteById(swiperId) > 0;
    }
}
